package cn.webrx;

public class If2 {
    public static void main(String[] args) {
        String str = "";
        int age = 18;
        //if语句  if else
        if (age >= 18) {
            str = "成年";
        } else {
            str = "未成年";
        }
        System.out.println(str);

        //三元运算符表达
        String info = age >= 18 ? "成年" : "未成年";
        System.out.println(info);


    }
}
